﻿CREATE PROCEDURE [dbo].[proc_Employee_Attendance_Create]
	(
		@UserName nvarchar(50),
		@TypeId int,
		@KouKuanAmount numeric(18,2),
		@KouKuanFromDate DateTime,
		@KouKuanToDate DateTime,
		@Description nvarchar(1000),
		@CreateName nvarchar(50),
		@CreateDate DateTime,
		@isFlag int,
		@Days float,
		@minute float,
		@m_flag int,
		@J_flag int,
		@t_flag int,
		@t_TypeName nvarchar(500)
	)
AS
	Begin
		Declare @CompanyId int,@DepartmentId int,@EName nvarchar(50)
		Set	@CompanyId = (Select CompanyId From Employee Where UserName=@UserName)
		Set	@DepartmentId = (Select DepartmentId From Employee Where UserName=@UserName)
		Set	@EName = (Select EName From Employee Where UserName=@UserName)
		
		Insert Into Employee_Attendance(UserName,EName,CompanyId,DepartmentId,TypeId,KouKuanAmount,
		KouKuanFromDate,KouKuanToDate,Description,CreateName,CreateDate,isFlag,[Days],[minute],m_flag,J_flag,t_flag,t_TypeName) 
		Values(@UserName,@EName,@CompanyId,@DepartmentId,@TypeId,@KouKuanAmount,@KouKuanFromDate,
		@KouKuanToDate,@Description,@CreateName,@CreateDate,@isFlag,@Days,@minute,@m_flag,@J_flag,@t_flag,@t_TypeName)

	End
	RETURN
